class Person {
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }


    @Override
    public boolean equals(Object obj) {
        Person tmp = (Person)obj;
        return tmp.name.equals(this.name);
    }
}
public class Main {
    public static void main(String[] args) {
        Person p1 = new Person("张三",100);
        Person p2 = new Person("张三",100);

        System.out.println(p1 == p2);
        System.out.println(p1.equals(p2));
    }
}